{include file="public/header" title='后台首页' keywords='关键字'}
<script src="__JS__/pintuer.js"></script>
</head>
<body>
<div class="bg"></div>
<div class="container">
    <div class="line bouncein">
        <div class="xs6 xm4 xs3-move xm4-move">
            <div style="height:150px;"></div>
            <div class="media media-y margin-big-bottom">
            </div>
            <form action="{:url('loginIn')}" method="post">
                <input type="hidden" name="__token__" value="{:token()}" />
                <div class="panel loginbox" style="position: relative">
                    <div class="text-center margin-big padding-big-top"><h1>后台管理中心</h1></div>
                    <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
                        <div class="form-group">
                            <div class="field field-icon-right">
                                <input type="text" class="input input-big account" name="name" placeholder="登录账号" data-validate="required:请填写账号" />
                                <span class="icon icon-user margin-small"></span>
                            </div>
                        </div>
                        <div class="form-group" id="for1">
                            <div class="field field-icon-right">
                                <input type="password" class="input input-big" name="password" placeholder="登录密码" data-validate="required:请填写密码" />
                                <span class="icon icon-key margin-small"></span>
                            </div>
                        </div>
                        <div class="form-group codediv" style="display: none">
                            <div class="field">
                                <input type="text" class="input input-big code" name="code" placeholder="填写右侧的验证码"  />
                                <img src="{:captcha_src()}" width="100" height="32" class="passcode" style="height:43px;cursor:pointer;" onclick="this.src=this.src+'?'">
                            </div>
                        </div>
                        <div class="form-group" style="padding-top: 30px;position: relative">
                            <div class="field field-icon-right" style="position:relative ">
                                <input type="checkbox" name="free" value="yes" id="">三十天免登录
                                <a href="{:url('loginEdit')}" style="position: absolute;right: 0px;color: blue;">忘记密码?</a>
                            </div>
                        </div>

                    </div>
                    <div style="padding:30px;"><input type="submit" class="button button-block bg-main text-big input-big sub" value="登录"></div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(".account").focus();
    $(".account").blur(function () {
        var account = $(".account").val();
        $.ajax({
            type: 'post',
            url: '{:url("ajaxAccount")}',
            data: {account:account},
            dataType : 'json',
            success: function (data) {
                if (data && data>=3){
                    $('.codediv').show();
                    if ($(".code").val()==""){
                        $('.sub').prop('disabled',true);
                    }
                }else{
                    $('.codediv').hide();
                }
            }
        })
    });

    $(".code").keyup(function () {
        var code = $(".code").val();

        $.ajax({
            type: 'post',
            url: '{:url("ajaxCode")}',
            data: {code:code},
            dataType: 'json',
            success: function (response) {
                if(response==1){
                    $('.sub').prop('disabled',false);
                }else{
                    $('.sub').prop('disabled',true);
                }
            }
        });
    });
</script>
</body>
</html>